
*%%.......................................................................................%%*

*Paper title:"Is the Future Female? A Conjoint Experiment on Voter Preferences in Six Arab Countries" *

*Code Authors: Samuel Tafesse Wakuma

*Lastupdated: Dec 27,2023

*%%.......................................................................................*%%*
*************************************************************************************************

/*This .do file encompasses all the ANALYSES, TABLES, and FIGURES presented in both the main text of the paper and the Supplementary information.

Please follow these instructions to ensure proper replication:

1)Install 'outreg2' and 'asdoc' to generate tables with the same formatting as in the paper.
2)Remove asterisks (*) in the for-loop codes to generate the table format in the appendix using the 'outreg2' function. Alternatively, the results can be replicated within the Stata result window.*/
	    																						
*************************************************************************************************


**#  Set up working folders --- NB. with your own paths!

* Open the data set

**# use "/IsFemaleFuture_Cleaned.dta", clear

* =====================================================================
__________________________________________________

**# Appendix B: Sample Characteristics
*________________________________________________________

**# Table B1. Distribution of Respondents by Country

asdoc tab Country
**# Table B2. Distribution of Respondents' Gender by Country (% excluding Refuse to Answer)

asdoc tab2 Country Respondent_Gender,row nofreq

**# Table B3. Respondents' Education Level by Country (%)
asdoc tab2 Country Education,row nofreq
**# Table B4. Respondents' Age Level by Country 
bys  Country: asdoc  tabstat Age, replace stat(N mean median p90 p99 min max iqr)



*________________________________________________________
**# Appendix C: Likelihood of Seeing a Candidate Like the One Shown 
*________________________________________________________

**# Table C1. Distribution of Likelihood of Seeing Candidate Like the One Shown

asdoc tab2 Country Likely_See_Similar_Candidate, row nofreq
* graph box Likely_See_Similar_Candidate, over(Country) title("Distribution of Likelihood of Seeing Candidate by Country") ylabel(0(1)10, grid)

*________________________________________________________

**# Appendix D: Full Models 
*________________________________________________________


**# Table D1. Main Treatment Effect Models, Willingness to Vote for as Dependent Variable 

*................Full sample
foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.Competency i.PartyGoals i.Successful i.Country_new
	// Output regression table with Full Model
	*outreg2 using D1.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Main Treatment Effect Models, Willingness to Vote for as Dependent Variable ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*................Country level
foreach i of num 1/6 {
    // Retrieve the label for the current country code
    local country_label: label (Country_new) `i'
    // Perform regression
    reg Vote_For i.CandidateGender i.Competency i.PartyGoals i.Successful  if Country_new == `i'
    // Output regression table with country label
    *outreg2 using D1.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(Main Treatment Effect Models, Willingness to Vote for as Dependent Variable)  ctitle(`country_label')
}


**# Table D2. Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Willingness to Vote for as Dependent Variable 


*..........Full sample
foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.Competency i.PartyGoals i.Successful  i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Country_new
	// Output regression table with Full Model
	*outreg2 using D2.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Willingness to Vote for as Dependent Variable ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    // Retrieve the label for the current country code
    local country_label: label (Country_new) `i'
    // Perform regression
    reg Vote_For i.CandidateGender i.Competency i.PartyGoals i.Successful  i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new == `i'
    // Output regression table with country label
    *outreg2 using D2.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Willingness to Vote for as Dependent Variable)  ctitle(`country_label')
}


**# Table D3. Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Expected Willingness of Others to Vote for the Candidate as Dependent Variable Model 1 with Dependent Variable Others Would Vote For		

*...............Full sample
foreach var of varlist Others_Would_Vote{
	reg `var' i.CandidateGender i.Competency i.PartyGoals i.Successful  i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Country_new
	// Output regression table with Full Model
	*outreg2 using D3.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Willingness of Others to Vote for the Candidate  as Dependent Variable ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*................Country level
foreach i of num 1/6 {
    // Retrieve the label for the current country code
    local country_label: label (Country_new) `i'
    // Perform regression
    reg Others_Would_Vote i.CandidateGender i.Competency i.PartyGoals i.Successful  i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new == `i'
    // Output regression table with country label
    *outreg2 using D3.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Willingness of Others to Vote for the Candidate  as Dependent Variable)  ctitle(`country_label')
}


**# Table D4. Main Treatment Effect Models with Influential People Endorse as Dependent Variable, Full Model and by Country

*......Full sample
foreach var of varlist Would_Infl_Endorse{
	reg `var' i.CandidateGender i.Competency i.PartyGoals i.Successful  i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Country_new
	// Output regression table with Full Model
	*outreg2 using D4.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Influential People Endorse as Dependent Variable ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.......Country level
foreach i of num 1/6 {
    // Retrieve the label for the current country code
    local country_label: label (Country_new) `i'
    // Perform regression
    reg Would_Infl_Endorse i.CandidateGender i.Competency i.PartyGoals i.Successful  i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new == `i'
    // Output regression table with country label
    *outreg2 using D4.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Influential People Endorse as Dependent Variable)  ctitle(`country_label')
}


**# Figure 3. Average Marginal Component Effects Model with Willingness to Vote for the Candidate and Others Willing to Vote for the Candidate as Dependent Variables


quietly reg Vote_For i.CandidateGender i.Competency i.Successful i.PartyGoals i.CandidateGender#i.Competency CandidateGender#i.Successful i.CandidateGender#i.Successful i.CandidateGender#i.PartyGoals i.Country
estimate store vote

quietly reg Others_Would_Vote i.CandidateGender i.Competency i.Successful i.PartyGoals i.CandidateGender#i.Competency CandidateGender#i.Successful i.CandidateGender#i.Successful i.CandidateGender#i.PartyGoals i.Country
estimate store othervote

coefplot (vote, color("22  27  57") ciopts(color("0 0 0")) msize(1.5) label(" Vote for ")) ///
       (othervote, color("72 138 146") ciopts(color("72 138 146")) msize(1.5) msymbol(x) label("Others Willing to Vote for ")), drop( 1.Country 3.Country 4.Country 5.Country 6.Country 8.Country _cons) ///
        xline(0, lcolor("red")) ///
		 title(Average Marginal Component Effects Model with Willingness to Vote for the Candidate and Others Willing to Vote for  ) ///
		 ylabel(none) ///
		 xline(0) ///
		 xline(0, lcolor("red")) ///
		 name(Fig3)

**# Table D5:  Influence of Gender Dynamics on Voting Behavior: Evaluating Support for Female Candidates Among Male and Female Respondents


*......Full sample
foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender   i.CandidateGender#i.Respondent_Gender   i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.Country_new
	// Output regression table with Full Model
	*outreg2 using D5.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Main Treatment Effect Models with CandidateGender Interactions with Respondent_Gender and all Other Treatments, Vote_For as Dependent Variable ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.......Country level
foreach i of num 1/6 {
    // Retrieve the label for the current country code
    local country_label: label (Country_new) `i'
    // Perform regression
    reg Vote_For i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender   i.CandidateGender#i.Respondent_Gender   i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender if Country_new == `i'
    // Output regression table with country label
    *outreg2 using D5.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(Main Treatment Effect Models with CandidateGender Interactions with Respondent_Gender and all Other Treatments, Vote_For as Dependent Variable )  ctitle(`country_label')
}

***************************************************************************************************
**# Tabels under D6 Main Treatment Effect Models with Competencies as Dependent Variables 


**# Table D6.1 Main Treatment Effect Models with Competencies as Dependent Variables full sample 

*.....Full sample
foreach outcome2 of varlist Good_Raise_Funds Good_Improve_Security Good_Promote_Development Good_Social_Probs Improve_Ntnl_Econ Help_Obtain_Services {
    // Retrieve the label for the outcome variable
    local outcome2_label: variable label `outcome2'

    // Perform regression
    reg `outcome2' i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Country_new

    // Output regression table with variable label
    *outreg2 using D6_1.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title("Main Treatment Effect Models with Competencies as Dependent Variables") addnote("Country Level fixed effects are omitted from Full Model (1)") drop(i.Country_new) ctitle(`outcome2_label')
}


**# Table 6.2 Main Treatment Effect Models with Competencies as Dependent Variables  male respondent
	
foreach outcomemale2 of varlist Good_Raise_Funds Good_Improve_Security Good_Promote_Development Good_Social_Probs Improve_Ntnl_Econ Help_Obtain_Services {
    // Retrieve the label for the outcome variable
    local outcomemale_label: variable label `outcomemale2'

    // Perform regression
    reg `outcomemale2' i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Country if Respondent_Gender==1
    // Store regression estimates
    estimates store `outcomemale2'
	// Output regression table with female
	*outreg2 using D6.2.xls, see text label append  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Main Treatment Effect Models with Competencies as Dependent Variables Male respondent sample) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(`outcomemale2')
}	
	
	
**# Table 6.3 Main Treatment Effect Models with Competencies as Dependent Variables  female respondent
		
foreach outcomefmale1 of varlist Good_Raise_Funds Good_Improve_Security Good_Promote_Development Good_Social_Probs Improve_Ntnl_Econ Help_Obtain_Services {
    // Retrieve the label for the outcome variable
    local outcomemale_label: variable label `outcomefmale1'

    // Perform regression
    reg `outcomefmale1' i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Country if Respondent_Gender==0
    // Store regression estimates
    estimates store `outcomefmale1'
	// Output regression table
	*outreg2 using D6.3.xls, see text label append  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Main Treatment Effect Models with Competencies as Dependent Variables Female respondent sample) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(`outcomefmale1')
}	
		
set scheme s1mono
**# Figure 4..for male respondents
foreach outcomemale of varlist Good_Raise_Funds Good_Improve_Security Good_Promote_Development Good_Social_Probs Improve_Ntnl_Econ Help_Obtain_Services {
    // Retrieve the label for the outcome variable
    local outcomemale_label: variable label `outcomemale'

    // Perform regression
    reg `outcomemale' i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Country if Respondent_Gender==1

    // Store regression estimates
    estimates store `outcomemale'
}


coefplot (Good_Raise_Funds, color("0 0 0") ciopts(color("0 0 0")) msize(1.5) label("Good at raising funds")) ///
         (Good_Improve_Security, color("0 0 0") ciopts(color("0 0 0")) msize(1.5) label("Good at ensuring security")) ///
         (Good_Promote_Development, color("0 0 0") ciopts(color("0 0 0")) msize(1.5) label("Good at local development")) ///
         (Improve_Ntnl_Econ, color("193 187 181") ciopts(color("193 187 181")) msize(1.5) label("Good at improving the national economy") mlabposition(0)) ///
         (Help_Obtain_Services, color("239 147 7") ciopts(color("239 147 7")) msize(2.0) label("Good at helping obtain services")) ///
         (Good_Social_Probs, color("255 0 0") ciopts(color("255 0 0")) msize(1.5)  label("Good at addressing social problems")) ///
         , drop(1.Competency 1.Successful 1.PartyGoals 1.CandidateGender#1.Competency 1.CandidateGender#1.Successful 1.CandidateGender#1.PartyGoals 1.Country 3.Country 4.Country 5.Country 6.Country 8.Country _cons) ///
         xline(0, lcolor("red")) title(Male Respondent ) //////
		 ylabel(none) ///
         xscale(range(-2.5 0.5)) ///
		 xlabel(-2.5(0.5) 0.5) ///
		 name(male)

		 
**# Figure 4..Female respondents

foreach outcomefmale of varlist Good_Raise_Funds Good_Improve_Security Good_Promote_Development Good_Social_Probs Improve_Ntnl_Econ Help_Obtain_Services {
    // Retrieve the label for the outcome variable
    local outcomemale_label: variable label `outcomefmale'

    // Perform regression
    reg `outcomefmale' i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Country if Respondent_Gender==0

    // Store regression estimates
    estimates store `outcomefmale'
}


coefplot (Good_Raise_Funds, color("0 0 0") ciopts(color("0 0 0")) msize(1.5) label("Good at raising funds")) ///
         (Good_Improve_Security, color("0 0 0") ciopts(color("0 0 0")) msize(1.5) label("Good at ensuring security")) ///
         (Good_Promote_Development, color("0 0 0") ciopts(color("0 0 0")) msize(1.5) label("Good at local development")) ///
         (Improve_Ntnl_Econ, color("193 187 181") ciopts(color("193 187 181")) msize(1.5) label("Good at improving the national economy") mlabposition(0)) ///
         (Help_Obtain_Services, color("239 147 7") ciopts(color("239 147 7")) msize(2.0) label("Good at helping obtain services")) ///
         (Good_Social_Probs, color("255 0 0") ciopts(color("255 0 0")) msize(1.5)  label("Good at addressing social problems")) ///
         , drop(1.Competency 1.Successful 1.PartyGoals 1.CandidateGender#1.Competency 1.CandidateGender#1.Successful 1.CandidateGender#1.PartyGoals 1.Country 3.Country 4.Country 5.Country 6.Country 8.Country _cons) ///
         xline(0, lcolor("red")) title(Female Respondent ) //////
		 ylabel(none) ///
         xscale(range(-2.5 0.5)) ///
		 xlabel(-2.5(0.5) 0.5) ///
		  name(fmale) 

**# Figure 4(male_female combined) Final used in the paper.	 
 grc1leg male fmale		 

***************************************************************************************************


**# Table D7.  Good_Raise_Funds , *....... Country Comparision( 


foreach i of num 1/6{
	 // Retrieve the label for the current country code
    local country_label: label (Country_new) `i'
    // Perform regression
	reg Good_Raise_Funds i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new==`i'
outreg2 using D7.xls, see text label append addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Base Model- Country level. Dependent variable = Good_Raise_Funds)  ctitle(`country_label')
}	
 
**# Table D8 Good_Improve_Security*....... Country Comparision(

foreach i of num 1/6{
	local country_label: label (Country_new) `i'
	reg Good_Improve_Security i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new==`i'
outreg2 using D8.xls, see text label append addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Base Model- Country level. Dependent variable = Good_Improve_Security) ctitle(`country_label')
}		
**# Table D9 Good_Promote_Development*....... Country Comparision(

foreach i of num 1/6{
	local country_label: label (Country_new) `i'
	reg Good_Promote_Development i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new==`i'
outreg2 using D9.xls, see text label append addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Base Model- Country level. Dependent variable = Good_Promote_Development)  ctitle(`country_label')
}		

**# Table D10 Good_Social_Probs*....... Country Comparision(

foreach i of num 1/6{
	local country_label: label (Country_new) `i'
	reg Good_Social_Probs i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new==`i'
outreg2 using D10.xls, see text label append addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Base Model- Country level. Dependent variable = Good_Social_Probs) ctitle(`country_label')
}		
**#Table D11 Improve_Ntnl_Econ*....... Country Comparision(

foreach i of num 1/6{
	local country_label: label (Country_new) `i'
	reg Improve_Ntnl_Econ i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new==`i'
outreg2 using D11.xls, see text label append addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Base Model- Country level. Dependent variable = Improve_Ntnl_Econ)  ctitle(`country_label')
}		
	
**#Table D12 Help_Obtain_Services*....... Country Comparision(
	
foreach i of num 1/6{
	local country_label: label (Country_new) `i'
	reg Help_Obtain_Services i.CandidateGender i.Competency i.PartyGoals i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new==`i'
outreg2 using D12.xls, see text label append addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Base Model- Country level. Dependent variable = Help_Obtain_Services)  ctitle(`country_label')
}	

***********************************************************************************************

/**# Table D26( table 5) Respondent Gender and candidate interaction Model 20 pap and H29
*..........Full sample
foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender   i.CandidateGender#i.Respondent_Gender   i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.Country_new
	*Output regression table with Full Model
	outreg2 using D26.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( D26 CandidateGender and respondent gender interaction ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    local country_label: label (Country_new) `i'
    reg Vote_For i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender   i.CandidateGender#i.Respondent_Gender   i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender if Country_new == `i'
    // Output regression table with country label
    outreg2 using D26.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(D26 CandidateGender and respondent gender interaction)  ctitle(`country_label')
}
 */
****************************************************************************************
**# Table D13 Belief in Gender and Competencies to Run a Business and CSO 
**# Table D13.1
tab BizAbility
**# Table D13.2
tab CSOAbility

**# Table D13.3
tab2 Country_new BizAbility
**# Table D13.2
tab Country_new CSOAbility

**# Tables D14 Distribution of Agreement with Statements of Benevolent and Hostile Sexism 

**# Table D14.1
tab BenSexism
**# Table D14.2
tab2 Country_new BenSexism

**# Table D14.3
tab HosSexism
**# Table D14.4
tab2 Country_new HosSexism

************************************************************************************************

**# Table D15 Model with Benevolent Sexism and all Interactions, Stated Willingness to Vote for Candidate as Dependent Variable, Full Model and by Country	benevolent

*..........Full sample
foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender  i.BenSexismbi i.CandidateGender#i.Respondent_Gender  i.CandidateGender#i.BenSexismbi i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#i.Respondent_Gender#i.BenSexismbi    i.CandidateGender#i.Competency#i.Respondent_Gender#i.BenSexismbi i.CandidateGender#i.PartyGoals#i.Respondent_Gender#i.BenSexismbi i.CandidateGender#i.Successful#i.Respondent_Gender#i.BenSexismbi i.Country_new
	// Output regression table with Full Model
	outreg2 using D15.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( CandidateGender,respondent gender and Benevolent Sexism interaction ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    local country_label: label (Country_new) `i'
    reg Vote_For i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender  i.BenSexismbi i.CandidateGender#i.Respondent_Gender  i.CandidateGender#i.BenSexismbi i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#i.Respondent_Gender#i.BenSexismbi    i.CandidateGender#i.Competency#i.Respondent_Gender#i.BenSexismbi i.CandidateGender#i.PartyGoals#i.Respondent_Gender#i.BenSexismbi i.CandidateGender#i.Successful#i.Respondent_Gender#i.BenSexismbi if Country_new == `i'
    // Output regression table with country label
    outreg2 using D15.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(CandidateGender,respondent gender and Benevolent Sexism interaction)  ctitle(`country_label')
	}


**# Table D16 Predictive Margins from Benevolent Sexism Model_VOTE FOR Full Model	

quietly reg Vote_For i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender  i.BenSexismbi i.CandidateGender#i.Respondent_Gender  i.CandidateGender#i.BenSexismbi i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#i.Respondent_Gender#i.BenSexismbi    i.CandidateGender#i.Competency#i.Respondent_Gender#i.BenSexismbi i.CandidateGender#i.PartyGoals#i.Respondent_Gender#i.BenSexismbi i.CandidateGender#i.Successful#i.Respondent_Gender#i.BenSexismbi  i.Country
*Table 16
margins CandidateGender#Respondent_Gender#BenSexismbi

**#  Figure 5.Predicted Stated Support for Male vs. Female Candidates, Given Respondent Gender and BenSexism 
set scheme s2color 
 marginsplot, ylab(3.5(1)9.5) yscale(range(3.5 9.5)) by( Respondent_Gender ) xlabel(, angle(45)) plot1opts(color("22 27 57")) plot2opts(color("72 138 146")) ytitle("Linear prediction in percentage points")

**# Table D17 Model with Hostile Sexism and all Interactions, Stated Willingness to Vote for Candidate as Dependent Variable, Full Model and by Country	
*..........Full sample
foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender  i.HosSexismbi i.CandidateGender#i.Respondent_Gender  i.CandidateGender#i.HosSexismbi i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#i.Respondent_Gender#i.HosSexismbi    i.CandidateGender#i.Competency#i.Respondent_Gender#i.HosSexismbi i.CandidateGender#i.PartyGoals#i.Respondent_Gender#i.HosSexismbi i.CandidateGender#i.Successful#i.Respondent_Gender#i.HosSexismbi i.Country_new
	// Output regression table with Full Model
	outreg2 using D17.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( CandidateGender,respondent gender and Hostile Sexism interaction ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    local country_label: label (Country_new) `i'
    reg Vote_For i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender  i.HosSexismbi i.CandidateGender#i.Respondent_Gender  i.CandidateGender#i.HosSexismbi i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#i.Respondent_Gender#i.HosSexismbi    i.CandidateGender#i.Competency#i.Respondent_Gender#i.HosSexismbi i.CandidateGender#i.PartyGoals#i.Respondent_Gender#i.HosSexismbi i.CandidateGender#i.Successful#i.Respondent_Gender#i.HosSexismbi if Country_new == `i'
    // Output regression table with country label
    outreg2 using D17.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(CandidateGender,respondent gender and Hostile Sexism interaction)  ctitle(`country_label')
	}
**# Table D18 Predictive Margins from Hostile Sexism Model with Stated Willingness to Vote for Candidate as Dependent Variable, Full Model	46

quietly reg Vote_For i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender  i.HosSexismbi i.CandidateGender#i.Respondent_Gender  i.CandidateGender#i.HosSexismbi i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#i.Respondent_Gender#i.HosSexismbi    i.CandidateGender#i.Competency#i.Respondent_Gender#i.HosSexismbi i.CandidateGender#i.PartyGoals#i.Respondent_Gender#i.HosSexismbi i.CandidateGender#i.Successful#i.Respondent_Gender#i.HosSexismbi i.Country

*Table D18
margins CandidateGender#Respondent_Gender#HosSexismbi
 

**# Figure 6.Predicted Stated Support for Male vs. Female Candidates, Given Respondent Gender and HosSexism 
marginsplot, ylab(3.5(1)9.5) yscale(range(3.5 9.5)) by( Respondent_Gender ) xlabel(, angle(45)) plot1opts(color("22 27 57")) plot2opts(color("72 138 146")) ytitle("Linear prediction in percentage points")




**# Table D19 Model 2, which is Model 1 adjusted with 4-Level Education, log of Age, Religiosity and Respondent Gender included, All Interactions. Willingness to Vote is the Dependent Variable 

foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age i.CandidateGender#i.Respondent_Gender i.CandidateGender#c.Religiosity i.CandidateGender#i.EDU_4LEVEL i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#Competency#c.Religiosity i.CandidateGender#PartyGoals#c.Religiosity i.CandidateGender#Successful#c.Religiosity i.CandidateGender#Competency#i.EDU_4LEVEL i.CandidateGender#PartyGoals#i.EDU_4LEVEL i.CandidateGender#Successful#i.EDU_4LEVEL i.CandidateGender#Competency#c.ln_Age i.CandidateGender#PartyGoals#c.ln_Age i.CandidateGender#Successful#c.ln_Age i.Country_new
	// Output regression table with Full Model
	outreg2 using D19.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title(  M1 With 4-Level Education, log of Age, Religiosity and Respondent Gender included ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    local country_label: label (Country_new) `i'
    reg Vote_For i.CandidateGender i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age i.CandidateGender#i.Respondent_Gender i.CandidateGender#c.Religiosity i.CandidateGender#i.EDU_4LEVEL i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#Competency#c.Religiosity i.CandidateGender#PartyGoals#c.Religiosity i.CandidateGender#Successful#c.Religiosity i.CandidateGender#Competency#i.EDU_4LEVEL i.CandidateGender#PartyGoals#i.EDU_4LEVEL i.CandidateGender#Successful#i.EDU_4LEVEL i.CandidateGender#Competency#c.ln_Age i.CandidateGender#PartyGoals#c.ln_Age i.CandidateGender#Successful#c.ln_Age if Country_new == `i'
    // Output regression table with country label
    outreg2 using D19.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(4-Level Education, log of Age, Religiosity and Respondent Gender included)  ctitle(`country_label')
	}
**# Figure 7 Marginal Plots of Respondent Gender and Religiosity on Stated Willingness to Vote for the Male vs. Female Candidate

quietly reg Vote_For  i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age i.CandidateGender#i.Respondent_Gender i.CandidateGender#c.Religiosity i.CandidateGender#i.EDU_4LEVEL i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#Competency#c.Religiosity i.CandidateGender#PartyGoals#c.Religiosity i.CandidateGender#Successful#c.Religiosity i.CandidateGender#Competency#i.EDU_4LEVEL i.CandidateGender#PartyGoals#i.EDU_4LEVEL i.CandidateGender#Successful#i.EDU_4LEVEL i.CandidateGender#Competency#c.ln_Age i.CandidateGender#PartyGoals#c.ln_Age i.CandidateGender#Successful#c.ln_Age  i.Country

margins CandidateGender#Respondent_Gender, at(Religiosity=(0(1)10))
marginsplot, plot1opts(color("22  27  57")) plot2opts(color("72 138 146"))  bydimension(Respondent_Gender) ylab(3.5(1)9.5) yscale( range(3.5 9.5)) ytitle("Linear prediction in percentage points")

*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*


**# Figure D1. Effect of Respondent Gender and Religiosity on Preference for Male and Female Candidates, by Country

reg Vote_For  i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age i.CandidateGender#i.Respondent_Gender i.CandidateGender#c.Religiosity i.CandidateGender#i.EDU_4LEVEL i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#Competency#c.Religiosity i.CandidateGender#PartyGoals#c.Religiosity i.CandidateGender#Successful#c.Religiosity i.CandidateGender#Competency#i.EDU_4LEVEL i.CandidateGender#PartyGoals#i.EDU_4LEVEL i.CandidateGender#Successful#i.EDU_4LEVEL i.CandidateGender#Competency#c.ln_Age i.CandidateGender#PartyGoals#c.ln_Age i.CandidateGender#Successful#c.ln_Age if Country==1
**# Egypt
margins CandidateGender#Respondent_Gender, at(Religiosity=(0(1)10))

 marginsplot,ylab(3.5(1)9.5) yscale(range(3.5 9.5)) ytitle("Linear prediction in percentage points")  title ("Egypt") saving(Egyptd1)  

reg Vote_For  i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age i.CandidateGender#i.Respondent_Gender i.CandidateGender#c.Religiosity i.CandidateGender#i.EDU_4LEVEL i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#Competency#c.Religiosity i.CandidateGender#PartyGoals#c.Religiosity i.CandidateGender#Successful#c.Religiosity i.CandidateGender#Competency#i.EDU_4LEVEL i.CandidateGender#PartyGoals#i.EDU_4LEVEL i.CandidateGender#Successful#i.EDU_4LEVEL i.CandidateGender#Competency#c.ln_Age i.CandidateGender#PartyGoals#c.ln_Age i.CandidateGender#Successful#c.ln_Age if Country==3

margins CandidateGender#Respondent_Gender, at(Religiosity=(0(1)10))

**# Algeria
marginsplot,ylab(3.5(1)9.5) yscale(range(3.5 9.5)) ytitle("Linear prediction in percentage points")  title("Algeria")saving(Algeriad1)  

reg Vote_For  i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age i.CandidateGender#i.Respondent_Gender i.CandidateGender#c.Religiosity i.CandidateGender#i.EDU_4LEVEL i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#Competency#c.Religiosity i.CandidateGender#PartyGoals#c.Religiosity i.CandidateGender#Successful#c.Religiosity i.CandidateGender#Competency#i.EDU_4LEVEL i.CandidateGender#PartyGoals#i.EDU_4LEVEL i.CandidateGender#Successful#i.EDU_4LEVEL i.CandidateGender#Competency#c.ln_Age i.CandidateGender#PartyGoals#c.ln_Age i.CandidateGender#Successful#c.ln_Age if Country==4

margins CandidateGender#Respondent_Gender, at(Religiosity=(0(1)10))

marginsplot, ylab(3.5(1)9.5) yscale(range(3.5 9.5)) ytitle("Linear prediction in percentage points") title("Morocco")saving(Moroccod1) 

**# Jordan
reg Vote_For  i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age i.CandidateGender#i.Respondent_Gender i.CandidateGender#c.Religiosity i.CandidateGender#i.EDU_4LEVEL i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#Competency#c.Religiosity i.CandidateGender#PartyGoals#c.Religiosity i.CandidateGender#Successful#c.Religiosity i.CandidateGender#Competency#i.EDU_4LEVEL i.CandidateGender#PartyGoals#i.EDU_4LEVEL i.CandidateGender#Successful#i.EDU_4LEVEL i.CandidateGender#Competency#c.ln_Age i.CandidateGender#PartyGoals#c.ln_Age i.CandidateGender#Successful#c.ln_Age if Country==5

margins CandidateGender#Respondent_Gender, at(Religiosity=(0(1)10))

marginsplot, ylab(3.5(1)9.5) yscale(range(3.5 9.5)) ytitle("Linear prediction in percentage points") title("Jordan")saving(Jordand1)
 
 **# Tunisia
reg Vote_For  i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age i.CandidateGender#i.Respondent_Gender i.CandidateGender#c.Religiosity i.CandidateGender#i.EDU_4LEVEL i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#Competency#c.Religiosity i.CandidateGender#PartyGoals#c.Religiosity i.CandidateGender#Successful#c.Religiosity i.CandidateGender#Competency#i.EDU_4LEVEL i.CandidateGender#PartyGoals#i.EDU_4LEVEL i.CandidateGender#Successful#i.EDU_4LEVEL i.CandidateGender#Competency#c.ln_Age i.CandidateGender#PartyGoals#c.ln_Age i.CandidateGender#Successful#c.ln_Age if Country==6

margins CandidateGender#Respondent_Gender, at(Religiosity=(0(1)10))

marginsplot, ylab(3.5(1)9.5) yscale(range(3.5 9.5)) ytitle("Linear prediction in percentage points") title("Tunisia")saving(Tunisiad1)  

 **# Libya
reg Vote_For  i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age i.CandidateGender#i.Respondent_Gender i.CandidateGender#c.Religiosity i.CandidateGender#i.EDU_4LEVEL i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.PartyGoals#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender i.CandidateGender#Competency#c.Religiosity i.CandidateGender#PartyGoals#c.Religiosity i.CandidateGender#Successful#c.Religiosity i.CandidateGender#Competency#i.EDU_4LEVEL i.CandidateGender#PartyGoals#i.EDU_4LEVEL i.CandidateGender#Successful#i.EDU_4LEVEL i.CandidateGender#Competency#c.ln_Age i.CandidateGender#PartyGoals#c.ln_Age i.CandidateGender#Successful#c.ln_Age if Country==8

margins CandidateGender#Respondent_Gender, at(Religiosity=(0(1)10))
marginsplot, ylab(3.5(1)9.5) yscale(range(3.5 9.5)) ytitle("Linear prediction in percentage points") title("Libya")saving(Libyad1)  

grc1leg Egyptd1.gph Algeriad1.gph Moroccod1.gph Jordand1.gph Tunisiad1.gph Libyad1.gph



*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*




**# Figure D2. Mean Religiosity Score across Age Groups

* Create separate datasets for individuals under 40 and 400 and over
gen age_group = .
replace age_group = 1 if Age < 40
replace age_group = 2 if Age >= 40

* Create age groups based on the ranges you've specified
egen age_group_detail = cut(Age), at(18 23 28 33 38 43 48 53 58 63 68 73 78 83 88 93 98)

* Calculate the proportion of individuals at each level of religiosity within each age group
egen meanT = mean(Religiosity), by(age_group_detail )

egen mean = mean(Religiosity), by(age_group_detail age_group)

* Generate line plots for each age group and combine them into a single graph
/*twoway (line mean age_group_detail if age_group == 1, sort) (line mean age_group_detail if age_group == 2, sort), legend(label(1 "Under 40") label(2 "40 and over")) xticks(18 23 28 33 38 43 48 53 58 63 68 73 78 83 88 93 98) xlabel(18 "18-22" 23 "23-27" 28 "28-32" 33 "33-37" 38 "38-42" 43 "43-47" 48 "48-52" 53 "53-57" 58 "58-62" 63 "63-67" 68 "68-72" 73 "73-77" 78 "78-82" 83 "83-87" 88 "88-92" 93 "93-97" 98 "98+", ang(45)) yticks(1(1)10) ylabel(1(1)10) title("Mean of Religiosity score across age groups") graphregion(lcolor(white))*/

label define ageg 18 "18-22" 23 "23-27" 28 "28-32" 33 "33-37" 38 "38-42" 43 "43-47" 48 "48-52" 53 "53-57" 58 "58-62" 63 "63-67" 68 "68-72" 73 "73-77" 78 "78-82" 83 "83-87" 88 "88-92" 93 "93-97" 98 "98+"
label values age_group_detail ageg

* best for above
twoway (line mean age_group_detail if age_group == 1, sort) ///
       (line mean age_group_detail if age_group == 2, sort), ///
       legend(label(1 "Under 40") label(2 "40 and over")) ///
       xticks(18 23 28 33 38 43 48 53 58 63 68 73 78 83 88 93 98) ///
       xlabel(18 "18-22" 23 "23-27" 28  "28-32" 33 "33-37" 38   "38-42" ///
              43 "43-47" 48 "48-52" 53 "53-57" 58 "58-62" 63 "63-67" ///
              68 "68-72" 73 "73-77" 78 "78-82" 83 "83-87" 88 "88-92" ///
              93 "93-97" 98 "98+", ang(45)) ///
       yticks(1(1)10) ylabel(1(1)10) note( "Dashed line are  at 29 40  63 years old |   About 90% of the sample is below 40 and 99% below 63 ") ///
       title("Mean of Religiosity score across age groups") ///
       graphregion(lcolor(white))  xline(29 40  63 , lpattern(dash) lcolor(black) )
	   

**# Table D20. Model 1 with Likelihood of Seeing Candidate as Dependent Variable, Full Model and by Country
foreach var of varlist Likely_See_Similar_Candidate{
	reg `var' i.CandidateGender i.Competency i.PartyGoals i.Successful  i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful i.Country_new

	outreg2 using D20.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title( Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Willingness to Vote for as Dependent Variable ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    // Retrieve the label for the current country code
    local country_label: label (Country_new) `i'
    // Perform regression
    reg Likely_See_Similar_Candidate i.CandidateGender i.Competency i.PartyGoals i.Successful  i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful if Country_new == `i'
   * Output regression table with country label
    outreg2 using D20.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title(Main Treatment Effect Models with Candidate Gender Interactions with all Other Treatments, Willingness to Vote for as Dependent Variable)  ctitle(`country_label')
}
	   
	   
	   
**# Table D21. Intersectionality between Respondent Age and Religiosity on Voters' Preferences

foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.Competency i.PartyGoals i.Successful c.Religiosity c.ln_Age i.CandidateGender#i.Competency i.CandidateGender#i.Successful i.CandidateGender#i.PartyGoals  i.CandidateGender#c.Religiosity  i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#c.Religiosity i.CandidateGender#i.Successful#c.Religiosity  i.CandidateGender#i.PartyGoals#c.Religiosity  i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age  i.CandidateGender#i.PartyGoals#c.ln_Age i.CandidateGender#i.Competency#c.Religiosity#c.ln_Age i.CandidateGender#i.Successful#c.Religiosity#c.ln_Age  i.CandidateGender#i.PartyGoals#c.Religiosity#c.ln_Age i.CandidateGender#c.Religiosity#c.ln_Age i.Country_new
	// Output regression table with Full Model
	outreg2 using D21.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title(  Table D21. Intersectionality between Respondent Age and Religiosity on Voters' Preferences) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    local country_label: label (Country_new) `i'
    reg Vote_For i.CandidateGender i.Competency i.PartyGoals i.Successful c.Religiosity c.ln_Age i.CandidateGender#i.Competency i.CandidateGender#i.Successful i.CandidateGender#i.PartyGoals  i.CandidateGender#c.Religiosity  i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#c.Religiosity i.CandidateGender#i.Successful#c.Religiosity  i.CandidateGender#i.PartyGoals#c.Religiosity  i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age  i.CandidateGender#i.PartyGoals#c.ln_Age i.CandidateGender#i.Competency#c.Religiosity#c.ln_Age i.CandidateGender#i.Successful#c.Religiosity#c.ln_Age  i.CandidateGender#i.PartyGoals#c.Religiosity#c.ln_Age i.CandidateGender#c.Religiosity#c.ln_Age if Country_new == `i'
    // Output regression table with country label
    outreg2 using D21.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title( Table D21. Intersectionality between Respondent Age and Religiosity on Voters' Preferences) addnote(Country Level fixed effects are omitted from Full Model (1))  ctitle(`country_label')
	}
	   
**# Table D22. Relationship between Respondent Demographics and Sexist Attitudes: Hostile Sexisim as Dependent Variable

foreach var of varlist HosSexismbi{
	reg `var' i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age  i.Country_new
	// Output regression table with Full Model
	outreg2 using D22.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title(  Table D22. Respondent Demographics and Sexist Attitudes: Hostile Sexisim ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    local country_label: label (Country_new) `i'
    reg HosSexismbi i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age  if Country_new == `i'
    // Output regression table with country label
    outreg2 using D22.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title( Table D22. Respondent Demographics and Sexist Attitudes: Hostile Sexisim) addnote(Country Level fixed effects are omitted from Full Model (1))  ctitle(`country_label')
	}


**# Table D23. Relationship between Respondent Demographics and Sexist Attitudes: Benevolent Sexism as Dependent Variable


foreach var of varlist BenSexismbi{
	reg `var' i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age  i.Country_new
	// Output regression table with Full Model
	outreg2 using D23.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title(  Table D22. Demographics and Sexist Attitudes: Benevolent Sexism  ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    local country_label: label (Country_new) `i'
    reg BenSexismbi i.Respondent_Gender c.Religiosity i.EDU_4LEVEL c.ln_Age  if Country_new == `i'
    // Output regression table with country label
    outreg2 using D23.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title( Table D23. Demographics and Sexist Attitudes: Benevolent Sexism ) addnote(Country Level fixed effects are omitted from Full Model (1))  ctitle(`country_label')
	}


**# Table D24. Influence of Age on the Association between Sexist Attitudes (Benevolent Sexism) and Voter Preferences: Willingness to Vote for as Dependent Variable  
	


foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful c.ln_Age  i.BenSexismbi i.CandidateGender#c.ln_Age  i.CandidateGender#i.BenSexismbi i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.PartyGoals#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age i.CandidateGender#c.ln_Age#i.BenSexismbi    i.CandidateGender#i.Competency#c.ln_Age#i.BenSexismbi i.CandidateGender#i.PartyGoals#c.ln_Age#i.BenSexismbi i.CandidateGender#i.Successful#c.ln_Age#i.BenSexismbi  i.Country_new
	// Output regression table with Full Model
	outreg2 using D24.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title(  Table D23. Influence of Age on the Association between Sexist Attitudes (Benevolent Sexism) and Voter Preferences: Willingness to Vote for as Dependent Variable  ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    local country_label: label (Country_new) `i'
    reg Vote_For i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful c.ln_Age  i.BenSexismbi i.CandidateGender#c.ln_Age  i.CandidateGender#i.BenSexismbi i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.PartyGoals#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age i.CandidateGender#c.ln_Age#i.BenSexismbi    i.CandidateGender#i.Competency#c.ln_Age#i.BenSexismbi i.CandidateGender#i.PartyGoals#c.ln_Age#i.BenSexismbi i.CandidateGender#i.Successful#c.ln_Age#i.BenSexismbi  if Country_new == `i'
    // Output regression table with country label
    outreg2 using D24.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title( Table D23. Influence of Age on the Association between Sexist Attitudes (Benevolent Sexism) and Voter Preferences: Willingness to Vote for as Dependent Variable ) addnote(Country Level fixed effects are omitted from Full Model (1))  ctitle(`country_label')
}

**# Table D25. Influence of Age on the Association between Sexist Attitudes (Hostile Sexism) and Voter Preferences: Willingness to Vote for as Dependent Variable  


foreach var of varlist Vote_For{
	reg `var' i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful c.ln_Age  i.HosSexismbi i.CandidateGender#c.ln_Age  i.CandidateGender#i.HosSexismbi i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.PartyGoals#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age i.CandidateGender#c.ln_Age#i.HosSexismbi    i.CandidateGender#i.Competency#c.ln_Age#i.HosSexismbi i.CandidateGender#i.PartyGoals#c.ln_Age#i.HosSexismbi i.CandidateGender#i.Successful#c.ln_Age#i.HosSexismbi  i.Country_new
	// Output regression table with Full Model
	outreg2 using D25.xls, see text label replace  addstat("F-Stat",e(F),"Prob > F",e(p),"Degree of Freedom",e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *)  title(  Table D25. Influence of Age on the Association between Sexist Attitudes (Hostile Sexism) and Voter Preferences: Willingness to Vote for as Dependent Variable  ) addnote(Country Level fixed effects are omitted from Full Model (1)) drop(i.Country_new) ctitle(Full Model)
}

*.........Country level
foreach i of num 1/6 {
    local country_label: label (Country_new) `i'
    reg Vote_For i.CandidateGender i.Competency i.PartyGoals  i.Successful i.CandidateGender#i.Competency i.CandidateGender#i.PartyGoals i.CandidateGender#i.Successful c.ln_Age  i.HosSexismbi i.CandidateGender#c.ln_Age  i.CandidateGender#i.HosSexismbi i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.PartyGoals#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age i.CandidateGender#c.ln_Age#i.HosSexismbi    i.CandidateGender#i.Competency#c.ln_Age#i.HosSexismbi i.CandidateGender#i.PartyGoals#c.ln_Age#i.HosSexismbi i.CandidateGender#i.Successful#c.ln_Age#i.HosSexismbi  if Country_new == `i'
    // Output regression table with country label
    outreg2 using D25.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title( Table D25. Influence of Age on the Association between Sexist Attitudes (Hostile Sexism) and Voter Preferences: Willingness to Vote for as Dependent Variable ) addnote(Country Level fixed effects are omitted from Full Model (1))  ctitle(`country_label')
}

	
**# Table D26. How Candidate Gender, Respondent Gender, and Respondent Age Interact to Influence Voting Behavior: A Subgroup Analysis Based on Sexism 

**# BenSexism Table D26

	
reg Vote_For i.CandidateGender i.Competency i.PartyGoals i.Successful i.Respondent_Gender c.ln_Age i.CandidateGender#i.Competency i.CandidateGender#i.Successful i.CandidateGender#i.PartyGoals  i.CandidateGender#i.Respondent_Gender  i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender  i.CandidateGender#i.PartyGoals#i.Respondent_Gender  i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age  i.CandidateGender#i.PartyGoals#c.ln_Age   i.CandidateGender#i.Competency#i.Respondent_Gender#c.ln_Age i.CandidateGender#i.Successful#i.Respondent_Gender#c.ln_Age  i.CandidateGender#i.PartyGoals#i.Respondent_Gender#c.ln_Age i.CandidateGender#i.Respondent_Gender#c.ln_Age i.Country  if BenSexismbi==1	

 outreg2 using D26.xls, see text label replace addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title( Table D26. How Candidate Gender, Respondent Gender, and Respondent Age Interact to Influence Voting Behavior: A Subgroup Analysis Based on Sexism ) addnote(Country Level fixed effects are omitted from Full Model (1))  ctitle(Yes)

**# Figure 8 Individuals Expressing Benevolent Sexism . 

margins CandidateGender#Respondent_Gender, at(ln_Age=(2(0.5)5))
 marginsplot,ylab(3.5(1)9.5) yscale(range(3.5 9.5)) by(Respondent_Gender) plot1opts(color("22  27  57")) plot2opts(color("72 138 146")) ytitle("Linear prediction in percentage points") saving(BenYes)
	
reg Vote_For i.CandidateGender i.Competency i.PartyGoals i.Successful i.Respondent_Gender c.ln_Age i.CandidateGender#i.Competency i.CandidateGender#i.Successful i.CandidateGender#i.PartyGoals  i.CandidateGender#i.Respondent_Gender  i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender  i.CandidateGender#i.PartyGoals#i.Respondent_Gender  i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age  i.CandidateGender#i.PartyGoals#c.ln_Age   i.CandidateGender#i.Competency#i.Respondent_Gender#c.ln_Age i.CandidateGender#i.Successful#i.Respondent_Gender#c.ln_Age  i.CandidateGender#i.PartyGoals#i.Respondent_Gender#c.ln_Age i.CandidateGender#i.Respondent_Gender#c.ln_Age i.Country  if BenSexismbi==0	

outreg2 using D26.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title( Table D26. How Candidate Gender, Respondent Gender, and Respondent Age Interact to Influence Voting Behavior: A Subgroup Analysis Based on Sexism ) addnote(Country Level fixed effects are omitted from Full Model (1))  ctitle(No)

**# Figure 8 Individuals NOT Expressing Benevolent Sexism .
 
margins CandidateGender#Respondent_Gender, at(ln_Age=(2(0.5)5))
 marginsplot,ylab(3.5(1)9.5) yscale(range(3.5 9.5)) by(Respondent_Gender) plot1opts(color("22  27  57")) plot2opts(color("72 138 146")) ytitle("Linear prediction in percentage points") saving(BenNo)
 

	
**# HosSexismSexism Table D26 second colomn

*YES HOS	
reg Vote_For i.CandidateGender i.Competency i.PartyGoals i.Successful i.Respondent_Gender c.ln_Age i.CandidateGender#i.Competency i.CandidateGender#i.Successful i.CandidateGender#i.PartyGoals  i.CandidateGender#i.Respondent_Gender  i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender  i.CandidateGender#i.PartyGoals#i.Respondent_Gender  i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age  i.CandidateGender#i.PartyGoals#c.ln_Age   i.CandidateGender#i.Competency#i.Respondent_Gender#c.ln_Age i.CandidateGender#i.Successful#i.Respondent_Gender#c.ln_Age  i.CandidateGender#i.PartyGoals#i.Respondent_Gender#c.ln_Age i.CandidateGender#i.Respondent_Gender#c.ln_Age i.Country  if HosSexismbi==1	

outreg2 using D26.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title( Table D26. How Candidate Gender, Respondent Gender, and Respondent Age Interact to Influence Voting Behavior: A Subgroup Analysis Based on Sexism ) addnote(Country Level fixed effects are omitted from Full Model (1))  ctitle(Yes)

**# Figure 9 Individuals Expressing HosSexism  . 
margins CandidateGender#Respondent_Gender, at(ln_Age=(2(0.5)5))
 marginsplot,ylab(3.5(1)9.5) yscale(range(3.5 9.5)) by(Respondent_Gender) plot1opts(color("22  27  57")) plot2opts(color("72 138 146")) ytitle("Linear prediction in percentage points") saving(hosYes)
	
*NO HOS	
reg Vote_For i.CandidateGender i.Competency i.PartyGoals i.Successful i.Respondent_Gender c.ln_Age i.CandidateGender#i.Competency i.CandidateGender#i.Successful i.CandidateGender#i.PartyGoals  i.CandidateGender#i.Respondent_Gender  i.CandidateGender#c.ln_Age i.CandidateGender#i.Competency#i.Respondent_Gender i.CandidateGender#i.Successful#i.Respondent_Gender  i.CandidateGender#i.PartyGoals#i.Respondent_Gender  i.CandidateGender#i.Competency#c.ln_Age i.CandidateGender#i.Successful#c.ln_Age  i.CandidateGender#i.PartyGoals#c.ln_Age   i.CandidateGender#i.Competency#i.Respondent_Gender#c.ln_Age i.CandidateGender#i.Successful#i.Respondent_Gender#c.ln_Age  i.CandidateGender#i.PartyGoals#i.Respondent_Gender#c.ln_Age i.CandidateGender#i.Respondent_Gender#c.ln_Age i.Country  if HosSexismbi==0	

outreg2 using D26.xls, see text label append addstat("F-Stat", e(F), "Prob > F", e(p), "Degree of Freedom", e(df_r)) alpha(0.001, 0.01, 0.05) symbol(***, **, *) title( Table D26. How Candidate Gender, Respondent Gender, and Respondent Age Interact to Influence Voting Behavior: A Subgroup Analysis Based on Sexism ) addnote(Country Level fixed effects are omitted from Full Model (1))  ctitle(No)

**# Figure 9 Individuals NOT Expressing HosSexism 
 
margins CandidateGender#Respondent_Gender, at(ln_Age=(2(0.5)5))
 marginsplot,ylab(3.5(1)9.5) yscale(range(3.5 9.5)) by(Respondent_Gender) plot1opts(color("22  27  57")) plot2opts(color("72 138 146")) ytitle("Linear prediction in percentage points") saving(hosNo)
 
*________________________________________________________

**# Appendix E: Multiple Hypothesis Testing 
*________________________________________________________

* Multiple Hypothesis Testing Section

* Note: This section handles multiple hypothesis testing using Holm and Bonferroni methods.


/*****************************************------********************************************************************/
* Due to hypotheses being tested in different models, manual steps of data preparation  in Excel  are needed   .
/*****************************************------********************************************************************/


* Step 1: Preparing Data in Excel
	*........... After generating results for each hypothesis using the appropriate model, manually edit the .xls file.
	* ...........Use the following example  command to generate the file in the desired format for Model1 
	* "..........." outreg2 using Model1.xls, see text label   replace noaster sideway noparen stats(coef se 	pval) pdec(5) drop(i.Country)"
	* ...........Remove top blank rows and unnecessary rows, including rows displaying outcome variables.
	* .........Ensure the final .xlsx file format has Variables, Coef, SE, Pval displayed horizontally at the top row.!!!!
	
	
	* ......Save the edited file as .xlsx 

* Step 2: Importing Data and reimport it into Stata.
import excel "file.xlsx", sheet("Sheet1") firstrow

* Step 3: Preparing Data for Analysis
* 
* Only keep variables corresponding to hypotheses tested in each model.

* Combine data for all hypotheses from all the models  into the same file.

* Assuming 'pval' and 'VARIABLES' are the column names in your dataset
clonevar p = pval
destring pval, replace
drop if pval == .
drop if strpos(VARIABLES, "Country") // Adjust this line based on your data
drop if VAR == "Constant" 

* Step 4: Holm and Bonferroni Adjustments

* Holm Adjustment
sort pval
*define 'k' here
gen k = (_N + 1) - _n 
gen Holms_threshold = 0.05 / k
gen reject_holm = pval <= Holms_threshold
label define holm 1 "Reject Null" 0 "Fail to Reject Null"
label values reject_holm holm

* Bonferroni Adjustment
*// define 'k' here _N as the number of comparisons (28 in our case this case).
gen Bonferroni_threshold = .05 / _N 
gen reject_bonferroni = pval <= Bonferroni_threshold
label define bonferroni 1 "Reject Null" 0 "Fail to Reject Null"
label values reject_bonferroni bonferroni

*Finaly export file in excel and format ( color code as needed, add colomn if needed  )

* Note: After completing these steps, review the output to interpret the results of the hypothesis tests.
